package com.byzk.p2p.front.controller;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.byzk.p2p.admin.base.controller.BaseController;
import com.byzk.p2p.admin.base.util.BaseUtil;
import com.byzk.p2p.admin.base.util.DateUtils;
import com.byzk.p2p.admin.base.util.JsonMsg;
import com.byzk.p2p.admin.base.util.MD5;
import com.byzk.p2p.admin.base.util.PageInfo;
import com.byzk.p2p.admin.borrow.service.BorrowService;
import com.byzk.p2p.admin.borrow.service.ChangeService;
import com.byzk.p2p.admin.borrow.service.TenderService;
import com.byzk.p2p.admin.borrow.vo.BorrowTenderVo;
import com.byzk.p2p.admin.borrow.vo.BorrowVo;
import com.byzk.p2p.admin.borrow.vo.ChangeVo;
import com.byzk.p2p.admin.system.dto.Page;
import com.byzk.p2p.admin.system.service.PageService;
import com.byzk.p2p.admin.system.service.SMSService;
import com.byzk.p2p.admin.user.dto.User;
import com.byzk.p2p.admin.user.dto.UserAccount;
import com.byzk.p2p.admin.user.service.UserAccountService;
import com.byzk.p2p.admin.user.service.UserAuthService;
import com.byzk.p2p.admin.user.service.UserService;
import com.byzk.p2p.admin.web.dto.Article;
import com.byzk.p2p.admin.web.dto.Banner;
import com.byzk.p2p.admin.web.service.ArticleService;
import com.byzk.p2p.admin.web.service.BannerService;
import com.byzk.p2p.admin.web.vo.ArticleVo;
import com.byzk.p2p.admin.web.vo.BannerVo;
import com.byzk.p2p.front.service.FrontUserService;
import com.byzk.p2p.front.util.FrontUtil;
import com.byzk.p2p.front.util.IndexShowVo;
import com.byzk.p2p.front.vo.CalculatorVo;
import com.byzk.p2p.front.vo.ProtocolVo;

/**
 * 跳转链接
 * @author suker.zhou
 *
 */
@Controller
@Scope("prototype")
public class FrontController extends BaseController implements Serializable {
	
	@Autowired
	private ArticleService articleService;
	@Autowired
	private SMSService smsService;
	@Autowired
	private UserService userService;
	@Autowired
	private PageService pageService;
	@Autowired
	private TenderService tenderService;
	@Autowired
	private BorrowService borrowService;
	@Autowired
	private ChangeService changeService;
	@Autowired
	private BannerService bannerService;
	@Autowired
	private FrontUserService frontUserService;
	@Autowired
	private UserAccountService userAccountService;
	@Autowired
	private UserAuthService userAuthService ;
	
	private static final long serialVersionUID = 1L;

	/**
	 * 安全保障
	 * 
	 * @return
	 */
	@RequestMapping("/security")
	public ModelAndView safe(Model model) {
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		return new ModelAndView("/front/help/security");
	}

	/**
	 * 关于我们
	 * 
	 * @return
	 */
	@RequestMapping("/about")
	public ModelAndView about(Model model) {
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		//已经赚取的收益
		Double income = tenderService.getAllRecovedInterest();
		model.addAttribute("income", income);
		//平台总收益
		Double amount = tenderService.getAllTenderAmount(null,null);
		model.addAttribute("amount", amount);
		//累计注册人数
		Integer userCount = userService.countAll();
		model.addAttribute("userCount", userCount);
		//累计投资人数
		int tenderCount = tenderService.getTenderpeopleCount();
		model.addAttribute("tenderCount", tenderCount);
		model.addAttribute("updateDate", new Date());
		
		
		return new ModelAndView("/front/help/about");
	}

	@RequestMapping("/app/download")
	public ModelAndView app(){
		return new ModelAndView("/front/help/app");
	}
	/**
	 * 招贤纳士
	 * 
	 * @return
	 */
	@RequestMapping("/hiring")
	public ModelAndView hiring() {
		return new ModelAndView("/front/help/hiring");
	}

	/**
	 * 帮助中心
	 * @return
	 */
	@RequestMapping("/help")
	public ModelAndView help(Model model,@RequestParam(value="keyword",required=false) String keyword){
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		if(StringUtils.isNotBlank(keyword)){
			Page page=pageService.getByURL(keyword);
			model.addAttribute("page",page);
		}
		return new ModelAndView("/front/help/help");
	}

	/**
	 * 新手指南
	 * @return
	 */
	@RequestMapping("/guide")
	public ModelAndView nag(Model model){
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		return new ModelAndView("/front/help/guide");
	}
	
	/**
	 * 联系我们
	 * 
	 * @return
	 */
	@RequestMapping("/contact")
	public ModelAndView contactus(Model model) {
		return new ModelAndView("/front/help/contact");
	}

	/**
	 * 合作机构
	 * 
	 * @return
	 */
	@RequestMapping("/partner")
	public ModelAndView partner() {
		return new ModelAndView("/front/help/partner");
	}

	/**
	 * 友情链接
	 * 
	 * @return
	 */
	@RequestMapping("/youqing")
	public String youqing() {
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 网站公告
	 * 
	 * @return
	 */
	@RequestMapping(value="/wzgg",method=RequestMethod.GET)
	public String wzgg(Model model,
			   @RequestParam(value="index",required=false,defaultValue="1") int index,
			   @RequestParam(value="limit",required=false,defaultValue="10") int limit) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("status", 1);//已发布
		queryMap.put("type", "notice");
		PageInfo<ArticleVo> pageInfo = articleService.articleList(queryMap, index, limit);
		model.addAttribute("pageInfo", pageInfo);
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 公司动态
	 * 
	 * @return
	 */
	@RequestMapping(value="/gsdt",method=RequestMethod.GET)
	public String gsdt(Model model,
			   @RequestParam(value="index",required=false,defaultValue="1") int index,
			   @RequestParam(value="limit",required=false,defaultValue="10") int limit) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("status", 1);//已发布
		queryMap.put("type", "companyTrends");
		PageInfo<ArticleVo> pageInfo = articleService.articleList(queryMap, index, limit);
		model.addAttribute("pageInfo", pageInfo);
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 行业新闻
	 * 
	 * @return
	 */
	@RequestMapping(value="/hyxw",method=RequestMethod.GET)
	public String hyxw(Model model,
			   @RequestParam(value="index",required=false,defaultValue="1") int index,
			   @RequestParam(value="limit",required=false,defaultValue="10") int limit) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("status", 1);//已发布
		queryMap.put("type", "news");
		PageInfo<ArticleVo> pageInfo = articleService.articleList(queryMap, index, limit);
		model.addAttribute("pageInfo", pageInfo);
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 媒体报道
	 * 
	 * @return
	 */
	@RequestMapping(value="/mtbd",method=RequestMethod.GET)
	public String mtbd(Model model,
			   @RequestParam(value="index",required=false,defaultValue="1") int index,
			   @RequestParam(value="limit",required=false,defaultValue="10") int limit) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("status", 1);//已发布
		queryMap.put("type", "mediaReports");
		PageInfo<ArticleVo> pageInfo = articleService.articleList(queryMap, index, limit);
		model.addAttribute("pageInfo", pageInfo);
		return ftl(Thread.currentThread().getStackTrace());
	}
	

	/**
	 * 网站新闻（内容）
	 * @param model
	 * @param id 文章id
	 * @param type 类型
	 * @return
	 */
	@RequestMapping(value="/article",method=RequestMethod.GET)
	public String article(Model model,@RequestParam Integer id,@RequestParam String type) {
		ArticleVo articleVo = articleService.getArticleById(id);
		if (articleVo != null) {
			Integer hitCount = articleVo.getHits();
			//点击数
			Article article = new Article();
			article.setId(articleVo.getId());
			article.setHits(hitCount == null?1:++hitCount);
			articleService.saveOrUpdateArticle(article);
			//相临文章
			//上一篇
			HashMap<String, Object> ltMap = new HashMap<String, Object>();
			ltMap.put("id", id);
			ltMap.put("type", type);
			ltMap.put("status", 1);//已发布
			ltMap.put("matchLt", "matchLt");
			//下一篇
			HashMap<String, Object> gtMap = new HashMap<String, Object>();
			gtMap.put("id", id);
			gtMap.put("type", type);
			gtMap.put("status", 1);//已发布
			gtMap.put("matchGt", "matchGt");
			Article ltArticle = articleService.getAdjacentArticle(ltMap);
			Article gtArticle = articleService.getAdjacentArticle(gtMap);
			model.addAttribute("ltArticle", ltArticle);
			model.addAttribute("gtArticle", gtArticle);
			model.addAttribute("type", type);
		}
		model.addAttribute("model", articleVo);
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 分页查询文章列表
	 * @param model
	 * @param createMonth 文章创建月份
	 * @param type 文章类型（notice:网站公告；companyTrends：公司动态；news:行业新闻；mediaReports：媒体报道）
	 * @param index 当前页
	 * @param limit 每页条数
	 * @throws Exception
	 */
	@RequestMapping(value="/articleList",method=RequestMethod.POST)
	public void articleList(Model model,@RequestParam String type,
				@RequestParam(value="createMonth",required=false)String createMonth,
				@RequestParam(value="index",required=false,defaultValue="1") int index,
				@RequestParam(value="limit",required=false,defaultValue="10") int limit) throws Exception{
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("status", 1);//已发布
		queryMap.put("type", type);
		if (StringUtils.isNotBlank(createMonth)) {
			//当前月的发布文章
			queryMap.put("createYear", DateUtils.convert(createMonth, "yyyy"));
			queryMap.put("createMonth", DateUtils.convert(createMonth, "MM"));
		}
		PageInfo<ArticleVo> pageInfo = articleService.articleList(queryMap, index<=0?1:index, limit);
		printJSON(new JsonMsg(-1, FrontUtil.pageHtml(pageInfo, index<=0?1:index).toString(),pageInfo.getPageList()));
	}
	
	@RequestMapping("/novice")
	public String novice(){
		return ftl(Thread.currentThread().getStackTrace());
	}

	/**
	 * 忘记密码
	 * @return
	 */
	@RequestMapping(value="/forget",method=RequestMethod.GET)
	public ModelAndView forget(){
		return new ModelAndView("/front/forget");
	}
	
	@RequestMapping(value="/forget",method=RequestMethod.POST)
	public String forget(@RequestParam("phone") String phone) throws Exception{
		if(StringUtils.isBlank(phone)){
			printJSON(new JsonMsg(1, "手机号码为空"));
			return null;
		}
		int intCount = 0;
		intCount = new Random().nextInt(9999);
		if (intCount < 1000) {
			intCount += 1000;
		}
//		String randomCode = "" + intCount;
		String randomCode="0000";
		session.setAttribute("randomCode", randomCode);
//		smsService.sendForgetPwdSms(phone, randomCode);
		printJSON(new JsonMsg(-1, "操作成功"));
		return null;
	}
	
	/**
	 * 修改登录密码页面
	 * @param phone 手机号
	 * @return
	 */
	@RequestMapping(value="/modify",method=RequestMethod.GET)
	public ModelAndView modifyPassword(@RequestParam("phone") String phone){
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("phone", phone);
		modelAndView.setViewName("/front/modify");
		return modelAndView;
	}
	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
	/**
	 * 修改用户登录密码
	 * @param phone 手机号
	 * @param code 验证码
	 * @param password 登录密码
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/updatePwd",method=RequestMethod.POST)
	public void updateUserPwd(@RequestParam(value="phone",required=false) String phone,@RequestParam(value="code",required=false) String code,
			@RequestParam(value="password",required=false) String password) throws Exception{
		if(StringUtils.isBlank(phone)){
			printJSON(new JsonMsg(1, "手机号码不能为空"));
			return;
		}		
		if(StringUtils.isBlank(code)){
			printJSON(new JsonMsg(2, "验证码不能为空"));
			return;
		}else{
			String randomCode=(String) session.getAttribute("randomCode");
			if(!code.equals(randomCode)){
				printJSON(new JsonMsg(3, "验证码错误"));
				return;	
			}
		}
		if(StringUtils.isBlank(password)){
			printJSON(new JsonMsg(4, "密码不能为空"));
			return;
		}	
		User temp = new User();
		temp.setPhone(phone);
		List<User> listUser=frontUserService.getByUser(temp);
		if(listUser!=null){
			temp = listUser.get(0);
			temp.setPassword(MD5.GetMD5Code(password));
			frontUserService.saveOrUpdate(temp);
			printJSON(new JsonMsg(-1, "操作成功"));
		}else{
			printJSON(new JsonMsg(5, "系统异常,请稍后再试!"));
		}
	}
	
	/**
	 * 登录密码找回成功
	 * @return
	 */
	@RequestMapping(value="/complete",method=RequestMethod.GET)
	public ModelAndView modifySuccess(){
		return new ModelAndView("/front/complete");
	}
	
	@RequestMapping(value="/huodong",method=RequestMethod.GET)
	public String huodong(){
		return ftl(Thread.currentThread().getStackTrace());
	}
	
	/**
	 * 进入首页
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = { "/index", "/" }, method = RequestMethod.GET)
	public ModelAndView index(Model model) throws Exception {
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		//发标公告
		List<Article> notices = articleService.listNewsByType(5,10);
		model.addAttribute("notices",notices);
		//公司公告(公司动态)
		List<Article> company = articleService.listNewsByType(1,2);
		model.addAttribute("company",company);
		//新闻中心(媒体报道)，显示前2笔
		List<Article> news = articleService.listNewsByType(6,2);
		model.addAttribute("news",news);
		//PC端banner
		/*Banner banner = new Banner();
		banner.setTerminal("PC");
		List<BannerVo> bannerList=bannerService.listBanner(banner);
		model.addAttribute("bannerList", bannerList);*/
		Banner banner = new Banner ();
		banner.setTerminal("PC");
		banner.setSpecific("B");
		List<BannerVo> bannerList=bannerService.listBanner(banner);
		model.addAttribute("bannerList", bannerList);
		
		banner.setTerminal("PC");
		banner.setSpecific("S");
		List<BannerVo> bannerList_s=bannerService.listBanner(banner);
		model.addAttribute("bannerList_s", bannerList_s);

		IndexShowVo indexShow=new IndexShowVo();
		
		int count=userService.countAll();
		indexShow.setRegCount(count);
		
		
		
		//已经赚取的收益
		Double income=tenderService.getAllRecovedInterest();
		indexShow.setIncome(income==null?0:income);
		//投资总金额
		Double amount = tenderService.getAllTenderAmount(null,null);
		indexShow.setAmount(amount==null?0:amount);
		//待收总金额
		Double awaitTotal = tenderService.getAllAwait();
		indexShow.setAwaitTotal(awaitTotal==null?0:awaitTotal);
		//今天投资总金额
		Date date1= DateUtils.getFirstSecondOfToday();//今天凌晨
		Double amount1 = tenderService.getAllTenderAmount(date1,null);
		indexShow.settAmount(amount1==null?0:amount1);
		//昨天的投资总额
		date1 = DateUtils.getFirstSecondOfYestoday();
		Double amount2 = tenderService.getAllTenderAmount(null,date1);
		indexShow.setyAmount(amount2==null?0:amount2);
		
		//借款标展示
		List<BorrowVo> borrowList = borrowService.FrontborrowList(3);
		model.addAttribute("borrowList", borrowList);

		//注意：需排除已取消的债权
		List<ChangeVo> changeList=changeService.top3ChangeList();
		indexShow.setChangeList(changeList);
		model.addAttribute("indexShow",indexShow);
		// 债权转让
		PageInfo<ChangeVo> pageInfo = changeService.listChange(1, 10, new ChangeVo());
		if (pageInfo != null && !pageInfo.getPageList().isEmpty() && pageInfo.getPageList().size() > 0) {
			for (ChangeVo item : pageInfo.getPageList()) {
				if (!"T".equals(item.getStatus())) {
					continue;
				}
				model.addAttribute("model", item);
				break;
			}
		}
		//媒体报道
		Map<String, Object> mediaMap = new HashMap<String, Object>();
		mediaMap.put("status", 1);
		mediaMap.put("type", "mediaReports");
		mediaMap.put("typeId", 1);
		PageInfo<ArticleVo> media = articleService.articleList(mediaMap, 1, 3);
		model.addAttribute("media",media);
		//有问必答或投资交流
		Map<String, Object>  mergeMap = new HashMap<String, Object>();
		mergeMap.put("status", 1);
		mergeMap.put("type", "merge");
		mergeMap.put("typeId", 2);
		PageInfo<ArticleVo>  mesh = articleService.articleList(mergeMap, 1, 3);
		model.addAttribute("mesh",mesh);
		
		model.addAttribute("user",user);

		return new ModelAndView("/front/index");
	}
	
	@RequestMapping("/protocol")
	public ModelAndView protocol(){
		return new ModelAndView("/front/protocol");
	}
	@RequestMapping("/new/borrow")
	public ModelAndView new_borrow(Model model ,
								@RequestParam(value="userId",required=false) Integer userId,
								@RequestParam(value="borrowId",required=false) Integer borrowId){
		ProtocolVo vo = frontUserService.getByUserIdAndBorrowId(userId, borrowId);
		if(vo != null){
			String money = FrontUtil.number2CNMontrayUnit(new BigDecimal(vo.getAmount()));
			vo.setMoney(money);
		}
		model.addAttribute("vo", vo);
		return new ModelAndView("/front/protocol/new_borrow");
	}
	
	@RequestMapping("/new/entrust")
	public ModelAndView new_entrust(){
		return new ModelAndView("/front/protocol/new_entrust");
	}
	
	@RequestMapping("/platina/entrust")
	public ModelAndView platina(){
		return new ModelAndView("/front/protocol/platina_entrust");
	}
	
	@RequestMapping("/mutualism/entrust")
	public ModelAndView mutualism(){
		return new ModelAndView("/front/protocol/mutualism_entrust");
	}
	
	/**
	 * 借款协议
	 */
	@RequestMapping("/loan")
	public ModelAndView loan(Model model,@RequestParam(value="borrowId",required=false) Integer borrowId){
		User user = (User) request.getSession().getAttribute("_user");
		if(user == null){
			return new ModelAndView("/front/user/login");
		}
		BorrowTenderVo borrowTender = tenderService.getUserTenderInfo(user.getId(),borrowId);
		model.addAttribute("model", borrowTender);
		return new ModelAndView("/front/protocol/loan");
	}
	
	/**
	 * 债权装让协议
	 */
	@RequestMapping("/change")
	public ModelAndView change(Model model, HttpServletRequest request) {
		String id = request.getParameter("id");
		if (id != null && !"".equals(id)) {
			ChangeVo vo = changeService.getChange(Integer.parseInt(id));
			if (vo != null) {
				if (vo.getChangeUserId() != null) {
					User changUser = userService.getById(vo.getChangeUserId());
					vo.setChangeUsername(changUser.getUsername());
				}
			}
			model.addAttribute("model", vo);
		}
		return new ModelAndView("/front/protocol/change_borrow");
	}
	@RequestMapping("/contract")
	public ModelAndView contract(Model model ,@RequestParam(value="id",required=false) Integer id){
		return new ModelAndView("/front/protocol/contract");
	}
	
	//理财计算器
	@RequestMapping("/calculator")
	public ModelAndView calculator(Model model){
		User user = (User) session.getAttribute("_user");
		user = userService.getById(user == null ?0:user.getId());
		UserAccount account = null ;
		HashMap<String,Integer> map = null ;
		if(user != null){
			account = userAccountService.getByUserId(user.getId());
			map = userAuthService.getUserAuthDetail(user.getId());
		}
		model.addAttribute("_account", account);
		model.addAttribute("auth", map);
		return new ModelAndView("/front/calculator");
	}
	
	@RequestMapping(value = "/calculator",method=RequestMethod.POST)
	public void cal(@ModelAttribute CalculatorVo vo) throws Exception{
		CalculatorVo cal = BaseUtil.calculator(vo);
		super.printJSON(new JsonMsg(-1, "计算成功！",cal));
	}

	@RequestMapping(value = "/activityCenter",method=RequestMethod.GET)
	public ModelAndView activityCenter() throws Exception{
		return new ModelAndView("/front/activityCenter");
	}
	
	@RequestMapping(value = "/item/business",method=RequestMethod.GET)
	public ModelAndView businessLoan() throws Exception{
		return new ModelAndView("/front/type/businessLoan");
	}
	
	@RequestMapping(value = "/item/car",method=RequestMethod.GET)
	public ModelAndView carLoan() throws Exception{
		return new ModelAndView("/front/type/carLoan");
	}

	@RequestMapping(value = "/item/house",method=RequestMethod.GET)
	public ModelAndView houseLoan() throws Exception{
		return new ModelAndView("/front/type/houseLoan");
	}
	
	@RequestMapping(value = "/item/promise",method=RequestMethod.GET)
	public ModelAndView promiseLoan() throws Exception{
		return new ModelAndView("/front/type/promiseLoan");
	}
	
	@RequestMapping(value = "/item/car/mortgage",method=RequestMethod.GET)
	public ModelAndView mortgageCarLoan() throws Exception{
		return new ModelAndView("/front/type/mortgageCarLoan");
	}
	
	@RequestMapping(value = "/course",method=RequestMethod.GET)
	public ModelAndView course(){
		return new ModelAndView("/front/course");
	}
	
	@RequestMapping(value="/insurance",method=RequestMethod.GET)
	public ModelAndView insurance(){
		return new ModelAndView("/front/insurance");
	}

	@RequestMapping(value="/reward",method=RequestMethod.GET)
	public ModelAndView reward(){
		return new ModelAndView("/front/inviteReward");
	}
	
	/** 活动链接 **/
	@RequestMapping(value="/activity/awardDetail",method=RequestMethod.GET)
	public ModelAndView awardDetail(){
		return new ModelAndView("/front/activity/awardDetails");
	}
	
	@RequestMapping(value="/activity/addInterest",method=RequestMethod.GET)
	public ModelAndView addInterest(){
		return new ModelAndView("/front/activity/addInterest");
	}
	
	@RequestMapping(value="/activity/escrow",method=RequestMethod.GET)
	public ModelAndView escrow(){
		return new ModelAndView("/front/activity/escrow");
	}
	
	@RequestMapping(value="/xbdrun",method=RequestMethod.GET)
	public ModelAndView xbdrun(){
		return new ModelAndView("/front/xbdrun");
	}
	
}
